
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')

module.exports = {

  configureWebpack: config => {
    config.plugins.push(AutoImport({
      resolvers: [ElementPlusResolver()],
    }))
    config.plugins.push(Components({
      resolvers: [ElementPlusResolver()],
    }))
  },

  /**
   * 配置跨域代理
   */
  devServer: {
    proxy: {
      '/api': {
        target: 'http://localhost:8090/',  //应该填写你们真实的后台接口
        changOrigin: true,  //允许跨域
        ws: true,
        pathRewrite: {
          '^/api': ''
        }
      },
    }
  },



}